<?php


namespace Drupal\shusy_city\ViewsController\handler\filter;


use Drupal\shusy_city\Entity\ShusyCity;
use views_handler_filter_in_operator;

class ShusyCityListViewsFilter extends views_handler_filter_in_operator {

  function get_value_options() {
    $options = [];
    $es = shusy_city_load_multiple(FALSE, ['status' => [0, 1]]);
    foreach ($es as $e) {
      if ($e instanceof ShusyCity) {
        $options[$e->id] = $e->label();
      }
    }
    if (!isset($this->value_options)) {
      $this->value_title = t('列表');
      $this->value_options = $options;
    }
  }
}
